import random
def matrix(n):
    for i in range(0,n):
        for j in range(0,n):
            r = random.randint(0,1)
            print(r,end=' ')
        print()

def main():
    n = eval(input("请输入阶数："))
    matrix(n)

main()